<template>
	<view class="container">
		<view>
			<desc-wrapper :title="title" :desc="desc"></desc-wrapper>
			 <z-card justifyContent="center" >
				 <view class="time" style="margin: 0 auto;">
				 	{{yangli}}
				 </view>
				 <view class="time" style="margin: 0 auto;">
				 	{{xingqi}}
				 </view>
				 <view class="time" style="margin: 0 auto;">
				 	{{yinli}}
				 </view>
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-red">【宜】</text>
					<view class="card-content_right">
						{{yi}}
					</view>
				</view>
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-green">【忌】</text>
					<view class="card-content_right">
						{{ji}}
					</view>
				</view>
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-orange">【五行】</text>
					<view class="card-content_right">
						{{wuxing}}
					</view>
				</view>
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-lightblue">【冲煞】</text>
					<view class="card-content_right">
						{{chongsha}}
					</view>
				</view>
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-purple">【吉神】</text>
					<view class="card-content_right">
						{{jishen}}
					</view>
				</view>
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-deepblue">【凶神】</text>
					<view class="card-content_right">
						{{xiongshen}}
					</view>
				</view>
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-brown">【百忌】</text>
					<view class="card-content_right">
						{{baiji}}
					</view>
				</view>
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-brown">【贵神方位】</text>
					<view class="card-content_right">
						{{guishenfangwei}}
					</view>
				</view>
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-brown">【喜神方位】</text>
					<view class="card-content_right">
						{{xishenfangwei}}
					</view>
				</view>
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-brown">【福神方位】</text>
					<view class="card-content_right">
						{{fushenfangwei}}
					</view>
				</view>
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-brown">【财神方位】</text>
					<view class="card-content_right">
						{{caishenfangwei}}
					</view>
				</view>
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-brown">【节气】</text>
					<view class="card-content_right">
						{{jieqi}}
					</view>
				</view>
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-brown">【本月胎神】</text>
					<view class="card-content_right">
						{{benyuetaishen}}
					</view>
				</view>
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-brown">【今日胎神】</text>
					<view class="card-content_right">
						{{jinritaishen}}
					</view>
				</view><view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-brown">【值星】</text>
					<view class="card-content_right">
						{{zhixing}}
					</view>
				</view>
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-brown">【六曜】</text>
					<view class="card-content_right">
						{{liuyao}}
					</view>
				</view>
				
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-brown">【七政】</text>
					<view class="card-content_right">
						{{qizheng}}
					</view>
				</view>
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-brown">【物候】</text>
					<view class="card-content_right">
						{{wuhou}}
					</view>
				</view>
	
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-brown">【宫兽】</text>
					<view class="card-content_right">
						{{gongshou}}
					</view>
				</view>
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-brown">【月相】</text>
					<view class="card-content_right">
						{{yuexiang}}
					</view>
				</view>
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-brown">【星宿】</text>
					<view class="card-content_right">
						{{xingxiu}}
					</view>
				</view>
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-brown">【天神】</text>
					<view class="card-content_right">
						{{tianshen}}
					</view>
				</view>
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-brown">【黄黑道】</text>
					<view class="card-content_right">
						{{huangheidao}}
					</view>
				</view>
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-brown">【吉凶】</text>
					<view class="card-content_right">
						{{jixiong}}
					</view>
				</view>
				<view class="card-content-item">
					<text class="card-content-label_left shrink-0 card-text-brown">【歌诀】</text>
					<view class="card-content_right">
						{{gejue}}
					</view>
				</view>
			</z-card>
			<view class="bottom-btns" style="transform: translateY(-100%);" @click="todashi">
				<view class="start-btn">
					<text>大师详解</text>
				</view>
			</view> 
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '万年历',
				
				desc: '分析结果如下，请自行体会其中的指示。',	
				yangli:'',
				xingqi:'',
				yinli:'',
				ji:'',
				yi:'',
				wuxing:'',
				chongsha:'',
				jishen:'',
				xiongshen:'',
				baiji:'',
				guishenfangwei:'',
				xishenfangwei:'',
				fushenfangwei:'',
				caishenfangwei:'',
				jieqi:'',
				benyuetaishen:'',
				jinritaishen:'',
				
				zhixing:'',
				liuyao:'',
				qizheng:'',
				wuhou:'',
				gongshou:'',
				yuexiang:'',
				xingxiu:'',
				tianshen:'',
				huangheidao:'',
				jixiong:'',
				gejue:''
				
			}
		},
		onLoad(options) {
		    const { yangli } = options;
		    const decodedYangli = decodeURIComponent(yangli);
		    console.log('Received 阳历:', decodedYangli);
		    // 根据需要使用 decodedYangli 的值
			
			const params = {
			    title_laohuangli: decodedYangli
			};		
			uni.request({
			    url: 'https://cs.appzdm.com:3000/Gongju/laohuangli',
			    method: 'POST',
			    header: {
			        'Content-Type': 'application/json'
			    },
			    data: params,
			    success: (res) => {
			        console.log(res, '###########');
                    this.yinli=res.data.data.yinli
					this.xingqi=res.data.data.xingqi
					this.yangli=res.data.data.yangli
					this.ji=res.data.data.ji
					this.yi=res.data.data.yi
					this.wuxing=res.data.data.wuxing
					this.chongsha=res.data.data.chongsha
					this.jishen=res.data.data.jishen
					this.xiongshen=res.data.data.xiongshen
					this.baiji=res.data.data.baiji
					this.guishenfangwei=res.data.data.guishenfangwei
					this.xishenfangwei=res.data.data.xishenfangwei
					this.fushenfangwei=res.data.data.fushenfangwei
					this.caishenfangwei=res.data.data.caishenfangwei
					this.jieqi=res.data.data.jieqi
					this.benyuetaishen=res.data.data.benyuetaishen
					this.fushenfangwei=res.data.data.fushenfangwei
					this.jinritaishen=res.data.data.jinritaishen
					
					this.zhixing=res.data.data.zhixing
					this.liuyao=res.data.data.liuyao
					this.qizheng=res.data.data.qizheng
					this.gongshou=res.data.data.gongshou
					this.yuexiang=res.data.data.yuexiang
					this.xingxiu=res.data.data.xingxiu
					this.tianshen=res.data.data.tianshen
					this.gejue=res.data.data.xingxiuge
					this.jixiong=res.data.data.jixiong
					this.huangheidao=res.data.data.huanghei
					this.wuhou=res.data.data.wuhou
			    },
			    fail: (error) => {
			        console.error('Request Failed:', error);
			    }
			});
		},


		methods: {
			todashi(){
				uni.switchTab({
					url:'/pages/tabbar/service'
				})
			}
		}
	}
</script>

<style>

</style>
